package com.oig.sys.workflow.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.EntityListeners;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GenerationType;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 * 流程实例
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_flow_instance")
@EntityListeners({AuditingEntityListener.class})
public class TbFlowInstance implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	@Column(name = "flow_config_id")
	private Integer flowConfigId;
	/**
	 * 流程编码
	 */
	@Column(name = "flow_code")
	private String flowCode;

	/**
	 * 流程名称
	 */
	@Column(name = "flow_name")
	private String flowName;
	/**
	 * 系统编码
	 */
	@Column(name = "sys_code")
	private String sysCode;

	/**
	 * 业务代码
	 */
	@Column(name = "biz_type")
	private String bizType;

	/**
	 * 业务单据id
	 */
	@Column(name = "biz_id")
	private String bizId;

	/**
	 * 审批数据json
	 */
	@Column(name = "flow_data")
	private String flowData;
	/**
	 * 状态
	 */
	@Column(name = "status")
	private String status;
	/**
	 * 审批提交次数
	 */
	@Column(name = "flow_req_num")
	private Integer flowReqNum;
	/**
	 * 审批最后提交时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "flow_req_time")
	private java.util.Date flowReqTime;

	@Column(name = "flow_req_msg")
	private String flowReqMsg;

	/**
	 * 审批实例id 提交飞书审批返回的实例id
	 */
	@Column(name = "flow_instance_id")
	private String flowInstanceId;


	/**
	 * 流程实例状态
	 */
	@Column(name = "flow_instance_status")
	private String flowInstanceStatus;

	/**
	 * 通知状态
	 */
	@Column(name = "notify_status")
	private String notifyStatus;

	/**
	 * 通知次数
	 */
	@Column(name = "notify_num")
	private Integer notifyNum;

	/**
	 * 通知时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_notify_time")
	private java.util.Date lastNotifyTime;

	/**
	 * 通知内容
	 */
	@Column(name = "last_notify_content")
	private String lastNotifyContent;

	/**
	 */
	@CreatedBy
	@Column(name = "create_user_id")
	private Integer createUserId;
	@Column(name = "create_user_code")
	private String createUserCode;
	/**
	 */
	@Column(name = "create_user_name")
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@LastModifiedBy
	@Column(name = "last_update_id")
	private Integer lastUpdateId;
	@Column(name = "last_update_code")
	private String lastUpdateCode;
	/**
	 */
	@Column(name = "last_update_name")
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;

	/**
	 */
	@Column(name = "tenant_id")
	private Integer tenantId;

	/**
	 */
	@Column(name = "tenant_name")
	private String tenantName;
}
